package com.rgsx.redisEntiy;

import com.rgsx.entiy.Position;
import com.rgsx.pojo.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRedisPojo implements Serializable {
    //主键
    private Long id;
    /**
     * 名字 来自于外部库
     */
    private String name;

    /**
     * 头像地址
     */
    private String headerUrl;

    /**
     * 0表示为用户  1表示司机
     */
    private Integer identity;

    private String password;

    private String userName;

    private Position position;

    public UserRedisPojo(User user, Position position){
        this.headerUrl = user.getHeaderUrl();
        this.userName = user.getUserName();
        this.identity = user.getIdentity();
        this.password = user.getPassword();
        this.id = user.getId();
        this.name = user.getName();
        this.position = position;
    }
}
